package dao;

import java.util.List;

import org.apache.ibatis.annotations.One;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import pojo.EssayAndUserAndComment;

public interface EssayAndUserAndCommentDao {

	@Select(value="select * from comment where essay_id=#{essayId}")
	@Results({ @Result(property = "commentId", column = "comment_id", id = true),
		@Result(property = "essayId", column = "essay_id"), 
		@Result(property = "userId", column = "user_id"),
		@Result(property = "commentDate", column = "comment_date"),
		@Result(property = "user", column = "user_id",one=@One(select="dao.UserMapper.selectByPrimaryKey"))
	 })
	public List<EssayAndUserAndComment> selectallcomment(Integer essayId);
}
